﻿using System;
using System.Collections.Generic;
using System.Text;

namespace T.FAS.Runtime.Metadata.Client
{
    /// <summary>
    /// 元数据缓存工厂类
    /// </summary>
    class MetaDataCacheFactory
    {
        public static IMetaDataCache GetCache(MetaDataCacheLevel cacheLevel)
        {
            IMetaDataCache cache = null;
            switch (cacheLevel)
            {
                case MetaDataCacheLevel.FirstLevel:
                    cache = MetaDataFirstCache.GetSingleton();
                    break;
                case MetaDataCacheLevel.SecondLevel:
                    cache = MetaDataSecondCache.GetSingleton();
                    break;
                default:
                    throw new NotSupportedException(cacheLevel.ToString());
            }

            return cache;
        }
    }
}
